clear yapdate yapdata bikdate bikdata;
s = dir('c:\manoj\geomag\data\210\yap\');
pp =1;
for i = 1:length(s)-2,
yapfile(pp,:) = (s(i+2).name);
pp = pp+1;
end;

for i = 1:length(yapfile),
[datax] = obs_read(['c:\manoj\geomag\data\210\yap\' yapfile(i,:)],'X');
[datay] = obs_read(['c:\manoj\geomag\data\210\yap\' yapfile(i,:)],'Y');
pp = 1;
for ii = 1:24,
    for  jj = 0:59,
        yapdate(i,pp) = tmjd(datax(ii,1),datax(ii,2),datax(ii,3),datax(ii,4),jj,30,1);
        pp = pp + 1;
    end;
end;
yapdata(i,:) = sqrt(reshape(datax(:,5:64)',[1,24*60]).^2+...
    reshape(datay(:,5:64)',[1,24*60]).^2);
end;

yapdata = yapdata*0.1;
% yapdh = yapdata - repmat(mean(yapdata(:,800:900),2),[1,1440]);
yaph = reshape(yapdata',[1,113*1440]);
yapdate  = reshape(yapdate',[1,113*1440]);
L = yapdate >= 890 & yapdate <= 895;
yap_eclipse_fday = yapdate(L);
yap_eclipse = yaph(L);
plot(yap_eclipse_fday,yap_eclipse,'r.');

%-------------
clear yapdate yapdata bikdate bikdata;
s = dir('c:\manoj\geomag\data\210\bik\');
pp =1;
for i = 1:length(s)-2,
bikfile(pp,:) = (s(i+2).name);
pp = pp+1;
end;

for i = 1:length(bikfile),
[datax] = obs_read(['c:\manoj\geomag\data\210\bik\' bikfile(i,:)],'X');
[datay] = obs_read(['c:\manoj\geomag\data\210\bik\' bikfile(i,:)],'Y');
pp = 1;
for ii = 1:24,
    for  jj = 0:59,
        bikdate(i,pp) = tmjd(datax(ii,1),datax(ii,2),datax(ii,3),datax(ii,4),jj,30,1);
        pp = pp + 1;
    end;
end;
bikdata(i,:) = sqrt(reshape(datax(:,5:64)',[1,24*60]).^2+...
    reshape(datay(:,5:64)',[1,24*60]).^2);
end;

bikdata = bikdata*0.1;
bikh = bikdata - repmat(mean(bikdata(:,800:900),2),[1,1440]);
bikdh = reshape(bikh',[1,167*1440]);
bikdate  = reshape(bikdate',[1,167*1440]);
L = bikdate >= 890 & bikdate <= 895;
bik_eclipse_fday = bikdate(L);
bik_eclipse = bikdh(L);
plot(bik_eclipse_fday,bik_eclipse,'r.');
%---------------

load c:\manoj\geomag\eclipse\KduCtaAsp fday kduh asph ctah;
% yapdh = yapdata - repmat(mean(yapdata(:,800:900),2),[1,1440]);

temp1 = reshape(kduh,[1440,5]);
temp2 = temp1 - repmat(mean(temp1(800:900,:),1),[1440,1]);
kduh = reshape(temp2,[1,1440*5]);

temp1 = reshape(asph,[1440,5]);
temp2 = temp1 - repmat(mean(temp1(800:900,:),1),[1440,1]);
asph = reshape(temp2,[1,1440*5]);

temp1 = reshape(ctah,[1440,5]);
temp2 = temp1 - repmat(mean(temp1(800:900,:),1),[1440,1]);
ctah = reshape(temp2,[1,1440*5]);
